var MYAPP = {};
//MYAPP.webroot = "http://myedu.com";
MYAPP.webroot = "http://jincaitong.wisapp.net";
MYAPP.animation = {
	type: 'movein',
	subtyoe: 'from_left',
	duration: 240
};
function uncompleted() {
	api.toast({
		msg: "该功能尚未开发完成!",
		duration: 2000,
		location: 'bottom'
	});
}

function login() {
	api.openWin({
		url: 'login.html',
		name: 'login',
		animation: MYAPP.animation
	});
}

function getUserKey() {
	var key = localStorage.getItem('key');
	if (key == '') {
		api.toast({
			msg: "还没登录哦!",
			duration: 2000,
			location: 'bottom'
		});
		//		setTimeout('login()', 2000);
		return false;
	} else {
		return key;
	}
}

function loginTimeOut() {
	localStorage.removeItem('key');
	api.toast({
		msg: "登录超时!请重新登录",
		duration: 2000,
		location: 'middle'
	});
	setTimeout('login()', 2000);
}

function showWaiting(msg) {
	api.showProgress({
		style: 'default',
		animationType: 'fade',
		title: '',
		text: msg,
		modal: false
	});
}

function hideWaiting() {
	api.hideProgress();
}

MYAPP.key = getUserKey();